package com.cskaoyan.service.wx_order_before.utils;

import com.cskaoyan.bean.wx_order.WXDetailOrderVO;
import com.cskaoyan.bean.wx_order_before.vo.HandleOptionBean;
import org.apache.shiro.crypto.hash.Hash;

import java.util.HashMap;
import java.util.Map;

/**
 * @author liXiaoFei
 * @date 2021/10/22 11:43
 */
public class OrderStatusUtils {

    public static Map<Integer,String> getOrderStatusText(){
        HashMap<Integer, String> orderStatusText = new HashMap<>();
        orderStatusText.put(101,"未付款");
        orderStatusText.put(102,"用户取消");
        orderStatusText.put(103,"系统取消");
        orderStatusText.put(201,"已付款");
        orderStatusText.put(202,"申请退款");
        orderStatusText.put(203,"已退款");
        orderStatusText.put(301,"已发货");
        orderStatusText.put(401,"用户收货");
        orderStatusText.put(402,"系统收货");
//        自定义 已评价
        orderStatusText.put(403,"已评价");
        return orderStatusText;
    }

    public static Map<Integer,Short[]> getOrderStatus(){
        HashMap<Integer, Short[]> orderStatus = new HashMap<>();
        orderStatus.put(1,new Short[]{101});
        orderStatus.put(2,new Short[]{201});
        orderStatus.put(3,new Short[]{301});
        orderStatus.put(4,new Short[]{401,402});
        return orderStatus;
    }

    public static Map<Integer, HandleOptionBean> getHandleOptionBeanByOrderStateMap(){
        HashMap<Integer, HandleOptionBean> bean = new HashMap<>();
        bean.put(1,new HandleOptionBean(true,false,true,false,false,false,false,false));
        bean.put(2,new HandleOptionBean(false,false,false,false,false,true,false,false));
        bean.put(3,new HandleOptionBean(false,false,false,false,true,false,false,false));
        bean.put(4,new HandleOptionBean(false,true,false,true,false,false,true,true));
        return bean;
    }
    public static Map<Integer, WXDetailOrderVO.OrderInfoDTO.HandleOptionDTO> getHandleOptionByOrderStatus(){
        HashMap<Integer, WXDetailOrderVO.OrderInfoDTO.HandleOptionDTO> handleOption = new HashMap<>();
        handleOption.put(101,new WXDetailOrderVO.OrderInfoDTO.HandleOptionDTO(true,false,true,false,false,false,false,false));
        handleOption.put(102,new WXDetailOrderVO.OrderInfoDTO.HandleOptionDTO(false,false,false,false,false,false,false,false));
        handleOption.put(201,new WXDetailOrderVO.OrderInfoDTO.HandleOptionDTO(false,false,false,false,false,true,false,false));
        handleOption.put(301,new WXDetailOrderVO.OrderInfoDTO.HandleOptionDTO(false,false,false,false,true,false,false,false));
        handleOption.put(401,new WXDetailOrderVO.OrderInfoDTO.HandleOptionDTO(false,true,false,true,false,false,true,true));
        handleOption.put(402,new WXDetailOrderVO.OrderInfoDTO.HandleOptionDTO(false,true,false,true,false,false,true,true));
        handleOption.put(403,new WXDetailOrderVO.OrderInfoDTO.HandleOptionDTO(false,true,false,false,false,true,true,true));
        return handleOption;
    }

}
